package com.ruoyi;

import cn.hutool.extra.qrcode.QrCodeUtil;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Base64;

/**
 * 启动程序
 * 
 * @author ruoyi
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication
{
    public static void main(String[] args)
    {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(RuoYiApplication.class, args);
        System.out.println("启动成功");

    }

    @Bean
    public WxPayService wxPayService(){
        final WxPayServiceImpl wxPayService = new WxPayServiceImpl();
        final WxPayConfig wxPayConfig = new WxPayConfig();
        wxPayConfig.setAppId("wx766459e5c7b98ac5");
        wxPayConfig.setMchId("1608401811");
        wxPayConfig.setMchKey("guatDevelopersguatDevelopers1234");
        wxPayConfig.setKeyPath("classpath:apiclieent_cert.p12");
        wxPayService.setConfig(wxPayConfig);
        return wxPayService;
    }


}
